import torch
from torch import nn

import d2l

print(torch.device('cpu'))
print(torch.device('cuda'))
print(torch.device('cuda:999'))
print(torch.cuda.device_count())
print(torch.cuda.is_available())
print(d2l.try_gpu())
print(d2l.try_gpu(10))
print(d2l.try_all_gpus())

x = torch.tensor([1, 2, 3])
print(f'x.device: {x.device}')

X = torch.ones(1, 1, device=d2l.try_gpu())
print(f'X: {X.mean()}')

